<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
 <script type="text/javascript">
    //1.初始化一个XmlHttpRequest 对象
      var xmlhttp=new XMLHttpRequest();
    //2.构建参数
      xmlhttp.open("get","AjaxServlet",true);
    //3.发送
      xmlhttp.send();
     //监听接收数据
      xmlhttp.onreadystatechange=function()
      {
    if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
        //将json字符串 转化成Json对象
           var obj=JSON.parse(xmlhttp.responseText);   
           console.log(obj);
    }
    }
    
  </script>

</head>
  
 


<body>

</body>
</html>